/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TestJPanel.java
 *
 * Created on 21 mai 2013, 16:51:41
 */

package Vue;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 *
 * @author yannick.henriet
 */
public class IHM_aboform extends javax.swing.JPanel {
	private JTextField textField_nom;
	private JTextField textField_prenom;
	private JTextField textField_numCB;
	private JTextField textField_adresse;
	
    /** Creates new form TestJPanel */
    public IHM_aboform() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        
        JLabel lblInformationAbonns = new JLabel("Information Abonn\u00E9s");
        lblInformationAbonns.setFont(new Font("Tahoma", Font.PLAIN, 18));
        
        textField_nom = new JTextField();
        textField_nom.setColumns(10);
        
        textField_prenom = new JTextField();
        textField_prenom.setColumns(10);
        
        textField_numCB = new JTextField();
        textField_numCB.setColumns(10);
        
        textField_adresse = new JTextField();
        textField_adresse.setColumns(10);
        
        JLabel lblNom = new JLabel("Nom");
        lblNom.setFont(new Font("Tahoma", Font.PLAIN, 15));
        
        JLabel lblPrnom = new JLabel("Pr\u00E9nom");
        lblPrnom.setFont(new Font("Tahoma", Font.PLAIN, 15));
        
        JLabel lblNumCarteBleue = new JLabel("Num Carte Bleue");
        lblNumCarteBleue.setFont(new Font("Tahoma", Font.PLAIN, 15));
        
        JLabel lblNewLabel = new JLabel("Adresse");
        lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
        
        JButton btnValider = new JButton("Valider");
        btnValider.addMouseListener(new MouseAdapter() {
        	@Override
        	public void mouseClicked(MouseEvent arg0) {
        		Control_IHM_user.getInstance().usrpoub2.setNom(textField_nom.getText());
        		Control_IHM_user.getInstance().usrpoub2.setPrenom(textField_prenom.getText());
        		Control_IHM_user.getInstance().usrpoub2.setNum_cb(textField_numCB.getText());
        		Control_IHM_user.getInstance().usrpoub2.setAdresse(textField_adresse.getText());
        		Control_IHM_user.getInstance().choixSelection("insert_abo"); // appel de la fonction de choix
        	}
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        layout.setHorizontalGroup(
        	layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(layout.createSequentialGroup()
        			.addGap(141)
        			.addComponent(lblInformationAbonns)
        			.addContainerGap(142, Short.MAX_VALUE))
        		.addGroup(layout.createSequentialGroup()
        			.addGap(31)
        			.addGroup(layout.createParallelGroup(Alignment.LEADING)
        				.addComponent(lblNom)
        				.addComponent(lblPrnom)
        				.addComponent(lblNumCarteBleue)
        				.addComponent(lblNewLabel))
        			.addPreferredGap(ComponentPlacement.RELATED, 98, Short.MAX_VALUE)
        			.addGroup(layout.createParallelGroup(Alignment.LEADING, false)
        				.addComponent(textField_adresse, Alignment.TRAILING)
        				.addComponent(textField_numCB, Alignment.TRAILING)
        				.addComponent(textField_prenom, Alignment.TRAILING)
        				.addComponent(textField_nom, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE))
        			.addGap(55))
        		.addGroup(layout.createSequentialGroup()
        			.addGap(180)
        			.addComponent(btnValider, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)
        			.addContainerGap(180, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
        	layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(layout.createSequentialGroup()
        			.addGap(27)
        			.addComponent(lblInformationAbonns)
        			.addGap(39)
        			.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        				.addComponent(textField_nom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        				.addComponent(lblNom))
        			.addPreferredGap(ComponentPlacement.UNRELATED)
        			.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        				.addComponent(textField_prenom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        				.addComponent(lblPrnom))
        			.addPreferredGap(ComponentPlacement.UNRELATED)
        			.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        				.addComponent(textField_numCB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        				.addComponent(lblNumCarteBleue))
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        				.addComponent(textField_adresse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        				.addComponent(lblNewLabel))
        			.addPreferredGap(ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
        			.addComponent(btnValider, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)
        			.addGap(28))
        );
        this.setLayout(layout);
    }// </editor-fold>//GEN-END:initComponents
}
